﻿using HT.Future.Entities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace HT.Future.IService
{
    public interface IOrganizationService : IBaseService<Department>
    {
        /// <summary>
        /// 导入组织架构
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        Task ImportOrganizationAsync(Stream stream);

        /// <summary>
        /// 导入人员
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        Task ImportUserAsync(Stream stream);
        /// <summary>
        /// 获取组织下的部门
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Department> GetChildsAsync(int id);
        /// <summary>
        /// 获取组织下的人员
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<User>> GetChildUsersAsync(int id);
        /// <summary>
        /// 导出部门下的所有员工
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<byte[]> GetDepartmentUsersToExcelAsync(int id);
        /// <summary>
        /// 更新组织信息
        /// </summary>
        /// <param name="department"></param>
        /// <returns></returns>
        Task<Department> UpdateAsync(Department department);
        /// <summary>
        /// 创建部门
        /// </summary>
        /// <param name="department"></param>
        /// <returns></returns>
        Task<Department> CreateDepartmentAsync(Department department);
        /// <summary>
        /// 获取组织下的最大排序码
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<int> ChildrenMaxSortAsync(int id);
        /// <summary>
        /// 获取组织架构层级文件
        /// </summary>
        /// <returns></returns>
        Task<byte[]> GetOrganizationExcelAsync();
        /// <summary>
        /// 获取所有用户的Excel文件
        /// </summary>
        /// <returns></returns>
        Task<byte[]> GetAllUsersToExcelAsync();
    }
}
